#include <string>
#include <vector>

class realvariable
{
  public:
    std::string name;
    double value;
};

class realvariablebag
{
  public:
    void set(std::string name, double value);
    double get(std::string name);
  private:
    std::vector<realvariable> listOfNumbers;
};

void realvariablebag::set(std::string name, double value)
{
  for(unsigned i = 0; i < listOfNumbers.size(); i++)
  {
    if(listOfNumbers[i].name == name)
    {
      listOfNumbers[i].value = value;
      return;
    }
  }
  realvariable rv;
  rv.name = name;
  rv.value = value;
  listOfNumbers.push_back(rv);
  return;
}

double realvariablebag::get(std::string name)
{
  for(unsigned i = 0; i < listOfNumbers.size(); i++)
  {
    if(listOfNumbers[i].name == name)
      return listOfNumbers[i].value;
  }
  realvariable rv;
  rv.name = name;
  rv.value = 0.0;
  listOfNumbers.push_back(rv);
  return 0.0;
}
